/* 
 * File:   lc_exception.h
 * Author: glenn
 *
 * Created on 3 décembre 2012, 00:25
 */

#ifndef LC_EXCEPTION_H
#define	LC_EXCEPTION_H

#include <stdio.h>
#include <stdlib.h>


#define THROW_EXCEPTION(message) \
        fprintf(stderr,"unknown exception from %s at line %i: %s\n",__FILE__,__LINE__,message);exit(-1);

#define THROW_OUTOFBOUND_EXCEPTION(index,bound)\
        fprintf(stderr,"OUT_OF_BOUND exception from %s at line %i: index (%i) out of bound (%i)\n",__FILE__,__LINE__,index,bound);exit(-1);

#define THROW_OUTOFMEMORY_EXCEPTION(allocated_size)\
        fprintf(stderr,"OUT_OF_MEMORY exception from %s at line %i: out of memory after %i\n",__FILE__,__LINE__,allocated_size);exit(-1);


#endif	/* LC_EXCEPTION_H */

